<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\daikuan\controller;

use cmf\controller\AdminBaseController;
use app\daikuan\model\LogistcsInterestModel;

/**
 * Description of InterestLogistcsController
 *
 * @author PVer
 */
class InterestLogistcsController extends AdminBaseController {

    //put your code here
    public function index() {
        $logistcsInterestModel = new LogistcsInterestModel();
        $info = $logistcsInterestModel->find();
        $this->assign("info", $info);
        return $this->fetch();
    }

    public function addPost() {
        if ($this->request->isPost()) {
            $data = $this->request->post();
            $logistcsInterestModel = new LogistcsInterestModel();
//            $arr = array();
//            $arr["flag"] = 1;
//            $driverInterestModel->save($arr, "id!=0");
            $result = $logistcsInterestModel->save($data, "id=1");
            if ($result !== false) {
                $this->success("操作成功", url("index"));
            } else {
                $this->error("操作失败");
            }
        }
    }

}
